﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Dynamic;
using M;
using Mysoft.MyCM.Scm;

namespace Mysoft.MyCM.Business.Scm
{
	/// <summary>
	/// TFS业务处理
	/// </summary>
	public class TfsBLL : BaseBLL
	{
		/// <summary>
		/// 获取指定TFS客户所使用的Tfs服务器信息
		/// </summary>
		/// <param name="customId">Tfs客户Id</param>
		/// <returns></returns>
		public Server GetTfsServerInfo(Guid customId)
		{
			MValidator.CheckForEmptyGUID("TFS客户Id", customId);
			using (var client = ScmWebApiClientManager.Manager.GetClient())
			{
				var result = client.GetSync<ApiResult<Server>>(string.Format("g/Custom/GetTFSServerInfoByCustom/{0}", customId));
				CheckResult(result);
				return result.Result;
			}
		}
	}
}
